package com.tdcoding.chat.dbase.mapper;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.tdcoding.chat.entities.DeviceInfo;
import com.tdcoding.chat.entities.FriendInfo;
import com.tdcoding.chat.entities.UserInfo;

public interface UserMapper {
	
	int register(UserInfo userInfo);
	
	UserInfo login(String userName);

	Long existUser(String userName);

	int existRoster(long userId, String rosterName);

	UserInfo queryUserInfo(long mUserId,long userId);

	List<UserInfo> queryUserList(long userId,String keyword, RowBounds rowBounds);

	List<String> queryMyRoster(long userId);

	FriendInfo queryFriendInfo(long userId,long friendId);

	List<FriendInfo> queryFriendList(long userId, int isFriend);

	int updateUserInfo(String set, String where);

	int updateUserPwd(long userId, String password);

	int updateUserHead(long userId, String userHead);

	int updateFriendInfo(String set, String where);

	int addFriend(FriendInfo friendInfo);

	int isMyFriend(long friendId);
	
	int allowAdd(long userId);

	int deleteFriend(long userId, long friendId);

	int deleteRoster(long userId, String rosterName);
	
	int isFollowing(long userId, long followId);

	int addFollowing(long userId, long followId, String followName);

	int cancelFollowing(long userId, long followId);

	int addDeviceInfo(long userId, String userName, DeviceInfo deviceInfo);
}
